<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      div {
        width: 100px;
        height: 2000px;
        background-color: darkcyan;
      }
    </style>
  </head>
  <body>
    <!-- <input type="text" placeholder="用户名" id="a" />
    <input type="password" placeholder="密码" id="b" />
    <button>注册</button> -->
    <div></div>
    <button>回到顶部</button>
    <script>
      //   实现一个用户名和密码注册 跳转到另一个页面显示
      var butEle = document.querySelector("button");
      var inputEle = document.getElementById("a");
      var inputEle1 = document.getElementById("b");
      butEle.onclick = function () {
        var a = inputEle.value;
        var b = inputEle1.value;
        window.location.href = "注册网站.html?用户名" + a + "密码=" + b;
      };
      //   回到顶部功能（慢慢的一点点）setinterval来减
      window.onscroll = function () {
        console.log(document.documentElement.scrollTop);
      };
      var butEle = document.querySelector("button");
      butEle.onclick = function () {
        var
      };
    </script>
  </body>
</html>
